class FlashBalance {
  late String amountUnit;
  late int amountValue;

  FlashBalance({required this.amountUnit, required this.amountValue});

  FlashBalance.fromJson(Map<String, dynamic> json) {
    amountUnit = json['amountUnit'];
    amountValue = json['amountValue']~/1000;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['amountUnit'] = this.amountUnit;
    data['amountValue'] = this.amountValue*1000;
    return data;
  }
}


class BalanceDetail {
  late String address;
  late String code;
  late double balance;
  late double price;
  late String imageUrl;
  late double usd;
  late String explorer;
  late String name;

  BalanceDetail(
      {required this.address,
        required this.code,
        required this.balance,
        required this.price,
        required this.imageUrl,
        required this.usd,
        required this.explorer,
        required this.name});

  BalanceDetail.fromJson(Map<String, dynamic> json) {
    address = json['address'];
    code = json['code'];
    balance = json['balance'];
    price = json['price'];
    imageUrl = json['imageUrl'];
    usd = json['usd'];
    explorer = json['explorer'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['address'] = address;
    data['code'] = code;
    data['balance'] = balance;
    data['price'] = price;
    data['imageUrl'] = imageUrl;
    data['usd'] = usd;
    data['explorer'] = explorer;
    data['name'] = name;
    return data;
  }
}
